import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '创建日期',
    dataIndex: 'createTime',
    width: 150,
  },
  {
    title: '订单号',
    dataIndex: 'orderNo',
    width: 160,
  },
  {
    title: '支付Id',
    dataIndex: 'payInfoId',
    width: 160,
  },
  {
    title: '打赏金额',
    dataIndex: 'totalPrice',
    width: 100,
  },
  {
    title: '打赏订单状态',
    dataIndex: 'orderStatus',
    width: 120,
    dictData: [
      { label: '待付款', value: 1 },
      { label: '已付款', value: 2 },
      { label: '已退款', value: 3 },
      { label: '申请退款中', value: 4 },
      { label: '已关闭', value: 5 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '机场',
    dataIndex: 'airportName',
    width: 150,
  },
  {
    title: '销售',
    dataIndex: 'employeeName',
    width: 150,
  },
  {
    title: '管家服务名称',
    dataIndex: 'goodsName',
    width: 150,
  },
  {
    title: '打赏人账号',
    dataIndex: 'mainAccount',
    width: 100,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'orderStatus',
    label: '打赏订单状态',
    component: 'Select',
    colProps: { span: 5 },
    componentProps: {
      options: [
        { label: '待付款', value: 1 },
        { label: '已付款', value: 2 },
        { label: '已退款', value: 3 },
        { label: '申请退款中', value: 4 },
        { label: '已关闭', value: 5 },
      ],
    },
  },
  {
    field: 'mainAccount',
    label: '打赏人账号',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'startDate',
    label: '开始日期',
    component: 'DatePicker',
    colProps: { span: 4 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'endDate',
    label: '结束日期',
    component: 'DatePicker',
    colProps: { span: 4 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
];
